// 一级页面
import Home from '../views/Home';
import About from '../views/About';
import My from '../views/My';
import Detail from '../views/Detail';
import Cate from '../views/Cate';
import Cart from '../views/Cart';
import Login from '../views/Login'


// 二级页面
import Cate1 from '../views/Cate/Cate1';
import Cate2 from '../views/Cate/Cate2';
import Cate3 from '../views/Cate/Cate3';

const routes = [
    {
        from: '/',
        to: '/home'
    },
    {
        path: '/home',
        component: Home,
        meta:{needLogin:false}
    },
    {
        path: '/login',
        component:Login,
        meta:{needLogin:false}
    },
    {
        path: '/cate',
        component: Cate,
        meta:{needLogin:false},
        children:[
            {
              from:"/cate",
              to:"/cate/cate1"
            },
            {
                path:'/cate/cate1',
                component:Cate1,          
            },
            {
                path:'/cate/cate2',
                component:Cate2,          
            }, {
                path:'/cate/cate3',
                component:Cate3,          
            }
        ]
    },
    {
        path: '/cart',
        component: Cart,
        meta:{needLogin:false}
    },
    {
        path: '/detail/:id',
        component: Detail,
        meta:{needLogin:false}
    },
    {
        path: '/about',
        component: About,
        meta:{needLogin:false}
    },
    {
        path: '/my',
        component: My,
        meta:{needLogin:true}
    }
]

export default routes;